%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Scenario 8.8 Transaction failures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Scenario 8.8 Transaction failures}

This scenario is about different transactions that fail for some reason. Because of these failures the customer wants to read her notifications and cancel a standing order. We will split this scenario in four separate actions to keep an overview.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Standing order failure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Standing order failure}
In the fist part we illustrate in figure \ref{fig:seq_8_8_Transaction_failures_standing_order} on page \pageref{fig:seq_8_8_Transaction_failures_standing_order} how a standing order is triggered and can fail. Standing orders are triggered by the \emph{Standing Order Module} that checks each day whether there are standing orders that need to be executed that day, this is illustrated by \texttt{initiateStandingOrders} in the diagram. Standing orders that need to be executed are handled as a Transaction by the \emph{Transaction Processing System} as illustrated in detail in figure \ref{fig:seq_UC11_Execute_transaction} on page \pageref{fig:seq_UC11_Execute_transaction}.

Because the account balance is insufficient, the \emph{Transaction Processing System} will not modify any balances and will send a notification of failure to the customer's \emph{Notification Inbox}.

The use case touched in this scenario is UC11: Execute transaction (alternative flow 1b.b.).

\begin{figure}[!h]
    \centering
        \includegraphics[width=1.0\textwidth]{Scenarios/scenario_img/8_8_Transaction_failures_standing_order.png}
    \caption{Standing order failure}
    \label{fig:seq_8_8_Transaction_failures_standing_order}
\end{figure}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Read notifications
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Read notifications}
In the second part we illustrate in figure \ref{fig:seq_8_8_Transaction_failures_Read_message} on page \pageref{fig:seq_8_8_Transaction_failures_Read_message} how the customer can read their notifications through SAB Online.

The use case touched in this scenario is UC17: Read messages.

\begin{figure}[!h]
    \centering
        \includegraphics[width=1.0\textwidth]{Scenarios/scenario_img/8_8_Transaction_failures_Read_message.png}
    \caption{Read notifications}
    \label{fig:seq_8_8_Transaction_failures_Read_message}
\end{figure}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Cancel standing order
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Cancel standing order}
In the third part we illustrate in figure \ref{fig:seq_8_8_Transaction_failures_cancel_standing_order} on page \pageref{fig:seq_8_8_Transaction_failures_cancel_standing_order} how the customer can select a standing order and cancel it.

The use case touched in this scenario is UC12: Cancel standing order.

\begin{figure}[!h]
    \centering
        \includegraphics[angle=90, width=0.6\textwidth]{Scenarios/scenario_img/8_8_Transaction_failures_cancel_standing_order.png}
    \caption{Cancel standing order}
    \label{fig:seq_8_8_Transaction_failures_cancel_standing_order}
\end{figure}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Interbank transaction failure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Interbank transaction failure}
The fourth part is about the SAB customer who sets up an interbank transaction that fails because the account at the other bank doesn't exist.

The initial debit of the SAB customer's account is executed by the \emph{Transaction Processing System} as illustrated in detail in figure \ref{fig:seq_UC11_Execute_transaction} on page \pageref{fig:seq_UC11_Execute_transaction}. After the debit is completed the remaining part of the transaction is send to the other bank over SWIFT as illustrated in detail in figure \ref{fig:seq_Outgoing_SWIFT} on page \pageref{fig:seq_Outgoing_SWIFT}.

The notification of failure by the other bank is send over SWIFT and is received by SAB as illustrated in detail in figure \ref{fig:seq_Incoming_SWIFT} on page \pageref{fig:seq_Incoming_SWIFT}. The incoming message of failure is converted into a Transaction that is executed by the \emph{Transaction Processing System} as illustrated in detail in figure \ref{fig:seq_UC11_Execute_transaction} on page \pageref{fig:seq_UC11_Execute_transaction}. This Transaction will undo the previous debit and send out a notification to the customer's \emph{Notification Inbox}.


The use cases touched in this scenario are:
\begin{itemize}
 \item UC23: Send interbank credit instruction
 \item UC11: Execute transaction (alternative flow 1a.b.)
 \item UC24: Receive status update for interbank credit instruction (Alternative flow 1b.)
\end{itemize}
